Closed kaushalmodi closed 6 years ago
This is related to https://github.com/gcushen/hugo-academic/issues/521. While that issue is fixed, a better fix for that issue and this one would be to do:
{{ with ($.Site.GetPage "KIND" "SECTION" .) }}
{{ .Permalink }}
{{ end }}
instead of:
{{ ($.Site.GetPage "KIND" "SECTION" .).Permalink }}
Even if you always expect that .GetPage
to work, you should still use with
, but may be do something like:
{{ with ($.Site.GetPage "KIND" "SECTION" .) }}
{{ .Permalink }}
{{ else }}
{{ errorf "You messed up something, do this to fix that." }}
{{ end }}
I forsee this same issue to happen at some point of time at all of these places:
layouts/partials/article_metadata.html
37: <a href="{{ ($.Site.GetPage "taxonomyTerm" "categories" .).Permalink }}">{{ . }}</a
layouts/partials/tags.html
6: <a class="btn btn-primary btn-outline" href="{{ ($.Site.GetPage "taxonomyTerm" "tags" .).Permalink }}">{{ . }}</a>
layouts/partials/talk_links.html
25:<a class="btn btn-primary btn-outline{{ if $is_list }} btn-xs{{end}}" href="{{ ($.Site.GetPage "page" "project" .).Permalink }}">
layouts/publication/single.html
35: <a href="{{ ($.Site.GetPage "section" "publication").Permalink }}#{{ . | urlize }}">
layouts/partials/widgets/posts.html
13: <a href="{{ ($.Site.GetPage "section" "post").Permalink }}">
layouts/partials/widgets/talks.html
12: <a href="{{ ($.Site.GetPage "section" "talk").Permalink }}">
layouts/partials/widgets/publications.html
12: <a href="{{ ($.Site.GetPage "section" "publication").Permalink }}">
layouts/partials/widgets/tag_cloud.html
27: <a href="{{ ($.Site.GetPage "taxonomyTerm" "tags" $name).Permalink }}" style="font-size:{{ $fontSize }}rem">{{ $name }}</a>
I've encountered these errors consistently while running Hugo-academic. I've used the temp fixes suggested by @kaushalmodi but an update + appropriate error message implemented in the next version of hugo-academic would be most helpful. thanks!
Thanks for reporting this.
Please can you update to the latest master version of Academic and confirm that the issue is resolved?
Not yet @gcushen I checked the end links to make sure they are pointing to a viable project name but I still see this error:
Started building sites ... ERROR 2018/05/08 18:12:31 Please check that the
projects
parameter in the front matter of content incontent/publication/
refers to an existing filename (without .md extension) of a published project. ERROR 2018/05/08 18:12:31 Please check that theprojects
parameter in the front matter of content incontent/talk/
refers to an existing filename (without .md extension) of a published project.
FWIW I think I may have the same problem. I am using RStudio, blogdown package, theme hugo-academic to build a website. If I start with the example website everything renders fine locally. If I add a [permalinks] statement to config.toml nothing renders and there are no error messages in the RStudio console (although I don't know if RStudio ever shows any hugo related errors). If I comment out the [permalink] everything renders OK again.
This is all while the content of the example site is unchanged from its distributed state. I presume the "projects" references from the example publications and talk are all consistent at this stage, so this permalinks problem doesn't seem to be related to non-existent projects being referenced from talks and publications.
If I delete the two example projects I get the "Please check that the projects parameter in the front matter ..." in the rendered entries for the example publications and talk. Of course I only see these messages when the site is re-rendered, so [permalinks] has to be off.
@rgayler I have set [permalinks]
for all 4 types of content in a test environment with the example site, running latest versions of Hugo and Academic and cannot reproduce the issue which you have described. Hence, based on the details which you have provided, it may possibly be a bug relating to Blogdown/Rstudio.
@jananiravi it appears that this issue is only affecting Blogdown/RStudio users and may be related to Blogdown/RStudio compatibility with Hugo's permalinks
and GetPage
functionality.
If you still experience an issue with the projects
parameter, try commenting out your existing projects
parameter and then setting projects = []
in the front matter of all your talks and publications. Ensure you don't set the parameter to [""]
as this will result in an error.
Thanks. I will refer it back to the RStudio/blogdown folks. This stretches across so many levels that it's hard to decide where it's breaking when you know as little about it as I do.
On Sun, 13 May 2018, 21:56 gcushen, notifications@github.com wrote:
@rgayler https://github.com/rgayler I have set [permalinks] for all 4 types of content in a test environment with the example site, running latest versions of Hugo and Academic and cannot reproduce the issue which you have described. Hence, based on the details which you have provided, it may possibly be a bug relating to Blogdown/Rstudio.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gcushen/hugo-academic/issues/534#issuecomment-388621522, or mute the thread https://github.com/notifications/unsubscribe-auth/AFKJG2NkczA5oOIcepjyPZl97OxqTh0Sks5tyB-IgaJpZM4T3K6R .
Sorry - should have asked: 1 what Hugo version did you test? 2 What Academic version did you test and how do I find out what version I have? 3 You mentioned permalinks for all 4 types of content. How did you do that? The documentation I was following was to enter two lines in config.toml, and it appeared to be global and agnostic as to the content type. Thanks
On Sun, 13 May 2018, 21:56 gcushen, notifications@github.com wrote:
@rgayler https://github.com/rgayler I have set [permalinks] for all 4 types of content in a test environment with the example site, running latest versions of Hugo and Academic and cannot reproduce the issue which you have described. Hence, based on the details which you have provided, it may possibly be a bug relating to Blogdown/Rstudio.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gcushen/hugo-academic/issues/534#issuecomment-388621522, or mute the thread https://github.com/notifications/unsubscribe-auth/AFKJG2NkczA5oOIcepjyPZl97OxqTh0Sks5tyB-IgaJpZM4T3K6R .
The test used the latest version of Academic (master version from Github, i.e. > v2.2.0) and Hugo (v0.40.3). The Update Guide (https://sourcethemes.com/academic/docs/update) describes how to update to latest version if you're not already on it.
Here is an example config.toml
entry to change permalinks for all 4 main content types:
[permalinks]
post = "/:slug"
talk = "/presentation/:slug"
publication = "/pub/:slug"
project = "/proj/:slug"
Thanks.
By date of setup and that fact that I have the privacy_pack option I think I must have Academic 2.2.0. Is the version number embedded anywhere in the downloaded code to provide easy confirmation?
On 13 May 2018 at 22:22, gcushen notifications@github.com wrote:
The test used the latest version of Academic (master version from Github, i.e. > v2.2.0) and Hugo (v0.40.3). The Update Guide ( https://sourcethemes.com/academic/docs/update) describes how to update to latest version if you're not already on it.
Here is an example config.toml entry to change permalinks for all 4 main content types:
[permalinks] post = "/:slug" talk = "/presentation/:slug" publication = "/pub/:slug" project = "/proj/:slug"
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gcushen/hugo-academic/issues/534#issuecomment-388622930, or mute the thread https://github.com/notifications/unsubscribe-auth/AFKJG6mqKkh9wjklkA4zEGyOHrSROu86ks5tyCWIgaJpZM4T3K6R .
Thanks @gcushen sorry, about the delay. I don't see this chunk or any reference to [permalinks] in my config.toml
file. I will include the quoted text you'd mentioned right before the following screenshot (which seems to be the only pertinent section in config.toml
)
[permalinks] post = "/:slug" talk = "/presentation/:slug" publication = "/pub/:slug" project = "/proj/:slug"
That's probably not the right way/place to do it since I still see the following error:
Started building sites ... ERROR 2018/05/17 11:18:29 Please check that the
projects
parameter in the front matter of content incontent/publication/
refers to an existing filename (without .md extension) of a published project. ERROR 2018/05/17 11:18:29 Please check that theprojects
parameter in the front matter of content incontent/talk/
refers to an existing filename (without .md extension) of a published project.
To be specific, these lines in my individual publication *.md files
are resulting in the listed error
ERROR 2018/05/17 11:18:29 Please check that the projects parameter in the front matter of content in content/publication/ refers to an existing filename (without .md extension) of a published project.
that appears this way (selected text) in the final rendered website
If I remove the text within the brackets as suggested by @gcushen, projects = []
the error message stops appearing but what if I want to link my publications/talks to projects? I tried changing the base url
within config.toml
but that only makes it worse. Please advise. thanks!
I've shared the files with @gcushen in case that would help fix the bugs.
At one stage I also got that error message, which was not related to the permalinks issue. In your case, what I understand it to be saying is that your publications have told Academic to link to the "stress-response" project, but Academic is unable to find the file "stress-response.md" in the content/project directory.
On 18 May 2018 at 02:29, Janani Ravi notifications@github.com wrote:
To be specific, these lines in my individual publication *.md files [image: image] https://user-images.githubusercontent.com/8397074/40189567-c3e42c68-59ca-11e8-8eda-e515b19ce935.png
are resulting in the listed error
ERROR 2018/05/17 11:18:29 Please check that the projects parameter in the front matter of content in content/publication/ refers to an existing filename (without .md extension) of a published project.
that appears this way (selected text) in the final rendered website [image: image] https://user-images.githubusercontent.com/8397074/40189610-e70ec20c-59ca-11e8-9d03-6058f8f14809.png
If I remove the text within the brackets as suggested by @gcushen https://github.com/gcushen, projects = [] the error message stops appearing but what if I want to link my publications/talks to projects? I tried changing the base url within config.toml but that only makes it worse. Please advise. thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gcushen/hugo-academic/issues/534#issuecomment-389927949, or mute the thread https://github.com/notifications/unsubscribe-auth/AFKJGwxJhocrG0hYrvRvmy86lTfNG2dGks5tzaVigaJpZM4T3K6R .
Please update Academic and you should receive much friendlier and more precise error messages in the case where your projects
file cannot be found. Please also try to specify the full project filename, e.g. projects = ["my-project-filename.md"]
- although this shouldn't matter too much if you're using a recent version of Hugo.
See https://discourse.gohugo.io/t/runtime-error-invalid-memory-address-or-nil-pointer-dereference/11881/10?u=kaushalmodi