8000 Unable to Include a single page besides "About" · Issue #197 · lukeorth/poison · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Unable to Include a single page besides "About" #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
iaintshootinmis opened this issue Sep 19, 2024 · 6 comments
Open

Unable to Include a single page besides "About" #197

iaintshootinmis opened this issue Sep 19, 2024 · 6 comments

Comments

@iaintshootinmis
Copy link
Contributor

I have a "Resume" page declared with the below code. However, when a visitor clicks on the Resume sidebar item, instead of loading the contents of Resume.md (like About does) it shows a link to the Resume along with the publish date (like a Post!)

menu = [ {Name = "About", URL = "/about/", HasChildren = false}, {Name = "Resume", URL = "/resume/", HasChildren = false}, {Name = "Posts", URL = "/posts/", Pre = "Recent", HasChildren = true, Limit = 5},

@iaintshootinmis
Copy link
Contributor Author
iaintshootinmis commented Sep 19, 2024

I resolved this by navigating to ./themes/poison/layouts and creating a new folder called resume. I then copied about.html from about into resume and renamed it to resume.html

From here, I modified line 6 to read as such:

Removed
{{ with .Site.GetPage "/about"}}

Added
{{ with .Site.GetPage "/resume" }}

This allowed the contents of content/resume/resume.md to load as a single page without a table of contents.

Leaving this open in case there is a better way to resolve this issue.

@iaintshootinmis
Copy link
Contributor Author

I know I'm talking to myself at this point, but that's ok. I've noticed that the about page doesn't populate the TOC. So now that's a new issue, as I want the Resume type to have a sidebar with sections of my resume loaded from # Headings.

Will update if I resolve this. And maybe the theme should have a default single pager? For resumes? Or for other things that need to be a single page W/ a TOC? If I figure out how to do one I'll make a pull request.

@allanmac
Copy link

Possible fix:

Full formatted text for a single page is shown up to a <!--more--> in your content's index.md.

Translation: strategically append a <!--more--> at the end of your resume?

@slatesuraj
Copy link
slatesuraj commented Jan 5, 2025

I did a workaround to fix the problem for me. It is not an optimal solution but it works.

  1. Created a directory with name resume at path themes/poison/layouts/ and resume.html file inside that dir.
  2. HTML file contains redir to /resume/resume which points to the actual post.

`

<title>Redirect Page</title> <script> // Redirect after 0 seconds (immediate redirect) window.setTimeout(function(){ window.location.href = "/resume/resume/"; }, 0); </script> `

@danialrami
Copy link
danialrami commented Jan 17, 2025

i'm running into the same issue. i tried copying the about page to a new resume/resume.html and then ran into the TOC issue as well. here is what my html file currently looks like, a copy of the about page. do you mean that you'd replace all of this code with the redirect script you shared, or something else?

{{ define "main" -}}
{{ if .Site.Params.light_dark }}
    {{ partial "light_dark.html" . }}
{{ end }}
<div class="post">
    {{ with .Site.GetPage "/resume" }}
        {{ if .Pages }}
            {{ range .Pages }}
                <h1 class="post-title">{{ .Title }}</h1>
                {{ .Content }}
            {{ end }}
        {{ else }}
            <h1 class="post-title">{{ .Title }}</h1>
            {{ .Content }}
        {{ end }}
    {{ end }}
    {{ if (.Site.Params.listmonk) }}
        {{ partial "post/listmonk_email_newsletters.html" . }}
    {{ end }}
</div>
{{ end }}

@slatesuraj
Copy link

Try to use layout: single and name the file _index.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0