perladvent / perldotcom

The source code for Perl.com website
https://www.perl.com
77 stars 79 forks source link

Update shortcodes for `perlfunc` and `perldoc` #253

Open briandfoy opened 4 years ago

briandfoy commented 4 years ago

I had to adjust the shortcode to strip trailing whitespace, then I converted many links to use the shortcodes.

oalders commented 11 months ago

I'm going to close and re-open this just to see if it creates a preview URL. (Deployment has not been changed in any way).

briandfoy commented 11 months ago

I don't think we had any actions tied to issues. Everything was something we typed by hand or that I had in a Makefile.

oalders commented 11 months ago

I don't think we had any actions tied to issues. Everything was something we typed by hand or that I had in a Makefile.

What I had done is linked the repo to render.com in the hope that we could leverage their functionality to review a PR as a deployed version of that branch. I was hoping we could just use their review mechanism without changing the deployment process. That would give us a visual on the PR without needing to change how the site actually works. I'll see if I missed something.

If there's a Makefile for creating the output for the staging repo, that would be handy to have here somewhere.

briandfoy commented 11 months ago

Let's make a new issue or whatever for this is you want to keep talking about it.

But, the "staging server" is really just the static site in the repo that NOC syncs. It's the deploy target that does that.

oalders commented 11 months ago

Let's make a new issue or whatever for this is you want to keep talking about it.

You don't want to merge this change?

briandfoy commented 11 months ago

Oh, yeah this can stay open. We are just off-topic on the other stuff.

render[bot] commented 11 months ago

Your Render PR Server URL is https://www-perl-com-pr-253.onrender.com.

Follow its progress at https://dashboard.render.com/static/srv-cj8jm3ee546c73a8401g.

oalders commented 11 months ago

Looks like this build fails on

Aug 7 02:43:27 PM  Start building sites …
Aug 7 02:43:27 PM  hugo v0.115.1-857374e69358f788bd31ddc55255c5c8e3dcfd80+extended linux/amd64 BuildDate=2023-07-03T17:28:25Z VendorInfo=gohugoio
Aug 7 02:43:27 PM  
Aug 7 02:43:34 PM  ERROR render of "term" failed: "/opt/render/project/src/layouts/_default/rss.xml:13:23": execute of template failed: template: _default/rss.xml:13:23: executing "_default/rss.xml" at <.URL>: can't evaluate field URL in type *hugolib.pageState
Aug 7 02:43:34 PM  Total in 6844 ms
Aug 7 02:43:34 PM  Error: error building site: render: failed to render pages: render of "home" failed: "/opt/render/project/src/layouts/_default/rss.xml:13:23": execute of template failed: template: _default/rss.xml:13:23: executing "_default/rss.xml" at <.URL>: can't evaluate field URL in type *hugolib.pageState
Aug 7 02:43:34 PM  ==> Build failed 😞

The build doesn't have this same issue in master.

oalders commented 11 months ago

This fixes it:

git diff
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml
index cafac65d..41129387 100644
--- a/layouts/_default/rss.xml
+++ b/layouts/_default/rss.xml
@@ -10,7 +10,7 @@
     <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
     <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
     <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
-    <atom:link href="{{.URL}}" rel="self" type="application/rss+xml" />
+    <atom:link href="{{.Permalink}}" rel="self" type="application/rss+xml" />
     {{ range first 15 .Data.Pages }}
     <item>
       <title>{{ .Title }}</title>
oalders commented 11 months ago

That's reverting it back to master.

briandfoy commented 11 months ago

Which version of Hugo are you using? These things are highly version specific and I think we were stuck on 0.59. If it works for some other version to that.

That was one of the more annoying parts of the site: you want something from a later Hugo, but they broke lots of other things.

oalders commented 11 months ago

I'm on

hugo v0.117.0-b2f0696cad918fb61420a6aff173eb36662b406e+extended darwin/arm64 BuildDate=2023-08-07T12:49:48Z VendorInfo=brew

Having said that, if the deployed site is just pulling static assets from TPF's staging repo, does it matter which version of hugo is actually being used to create the site?

My understanding of the workflow is:

Have I misunderstood?

briandfoy commented 11 months ago

Yes, that's the process. The Hugo version issue is about what it supports. You've seen such an issue with one of the names changing from .Url to .Permalink, or the other way around. Some of the stuff did not work with anything other than Hugo 0.59. I don't have the details because it's been awhile.

If you want to use a different Hugo and the site comes out fine, then go for it. But I'd look carefully at the diffs for the first few attempts.

oalders commented 11 months ago

In that case, is it ok if I push a commit to this branch? That should fix the build and give us a preview URL for the site built with a recent Hugo.

briandfoy commented 11 months ago

It's fine by me.

But, also realize you don't need my permission to do things with perl.com. Be bold. :)

oalders commented 11 months ago

But, also realize you don't need my permission to do things with perl.com. Be bold. :)

😄 Will do! As a rule I like to check in with people before I start pushing to the their branches. Let's see what happens with this commit.

oalders commented 11 months ago

The preview URL is now working: https://www-perl-com-pr-253.onrender.com/

oalders commented 11 months ago

@briandfoy does this need any kind of QA or is it ok to merge?

rwp0 commented 7 months ago

does this need any kind of QA or is it ok to merge?

Sorry @briandfoy, but have you tested the PR?

briandfoy commented 7 months ago

I have not tested this and am not going to. I expect it would take a lot of work to come in-line with whatever Hugo is doing now. If someone wants to do that, go for it. It's fine if you delete the PR.