Skip to content
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

How to change the default page? #9

Open
FFY00 opened this issue Jul 18, 2020 · 6 comments
Open

How to change the default page? #9

FFY00 opened this issue Jul 18, 2020 · 6 comments

Comments

@FFY00
Copy link

FFY00 commented Jul 18, 2020

Hi, I would like to change the index to the about page. Would this be possible? If so, how can I do it?

@bastienboutonnet
Copy link

I second this I'm looking into how to do the same thing

@athul
Copy link
Owner

athul commented Mar 24, 2021

Hey,
You can change that with a new _index.md file in the contents directory and add a {{.Content}} tag in the index.html file in the layouts directory.

Also remove these lines from the index.html file. These lines are for showing the list of blog posts. You can add another file with these contents and you could achieve the blog list

{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }}
{{ range $paginator.Pages }}
<section class="list-item">
<h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1>
<time>{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time>
<br><div class="description">
{{ if isset .Params "description" }}
{{ .Description }}
{{ else }}
{{ .Summary }}&hellip;
{{ end }}
</div>
<a href="{{ .RelPermalink }}">Read more ⟶</a>
</section>
{{ end }}
{{ template "partials/paginator.html" . }}

@bastienboutonnet
Copy link

Super! I got it now. Thanks a lot for the pointers

@uncouthregions
Copy link

uncouthregions commented Sep 23, 2022

Apologies for diging up this old discussion, but I have run into a problem when deploying to Netlify. Basically, everything works fine when I build locally. However, when I deploy, the first step (removing the lines that call the blog posts) does work. However, the material I added to _index.md doesn't take its place.

So the local build displays the new content, but the Netlify version just shows an empty space on the homepage.

Sorry if this is badly expressed. I'm learning things as I go along.

EDIT: this mysteriously (to me) just started working after I changed my github username.

@PabDJ
Copy link

PabDJ commented Nov 3, 2022

Hello @uncouthregions, @bastienboutonnet and @athul
After taking a look at this thread I still don't manage to change the default page. I want to change the current index page in order to show the about page.

I have removed the lines from archie/layouts/index.html but I don't get how to transform the _index.md file.

@PabDJ
Copy link

PabDJ commented Nov 13, 2022

Hello @uncouthregions, @bastienboutonnet and @athul After taking a look at this thread I still don't manage to change the default page. I want to change the current index page in order to show the about page.

I have removed the lines from archie/layouts/index.html but I don't get how to transform the _index.md file.

Fixed :)

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

5 participants