Comments (10)
@Keats additionally to the sitemap, the hidden property
feature would handle the fact that the internal search doesn't index these pages.
ATM for the bevyengine/bevy docs, we do not use the internal search feature so we can go with the solution you mentioned using extra
and modifying the sitemap.xml template (cc @tuyen-at-work):
[extra]
status = 'hidden'
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for sitemap_entry in entries %}
{% if not sitemap_entry.extra.status %}
<url>
<loc>{{ sitemap_entry.permalink | escape_xml | safe }}</loc>
{% if sitemap_entry.updated %}
<lastmod>{{ sitemap_entry.updated }}</lastmod>
{% endif %}
</url>
{% endif %}
{% endfor %}
</urlset>
But if we integrate the search engine, we will need this feature.
With the search engine problematic in mind, would you accept a PR to tackle this?
from zola.
draft
already covers most of these needs, but I'm not sure if it can be used on sections.
from zola.
@mwcz draft
is use for different purpose. For example on local you create a markdown file but decide that it is not ready for delivery then you mark it as draft
.
If you deliver the site with zola build --drafts
then the draft pages will be rendered, but they also appear in sitemap/feed/atom/search index. Therefore it does not serve the same purpose.
from zola.
I'm not sure we want that, that's pretty niche. You can accomplish the same by writing your own sitemap template and checking for a specific arg in extra
to not include them and when rendering section (breaks down though if you have hidden things in a paginated section).
from zola.
If you deliver the site with
zola build --drafts
then the draft pages will be rendered, but they also appear in sitemap/feed/atom/search index. Therefore it does not serve the same purpose.
zola build --drafts
zola build
Then deploy. I used to do that with Hugo and it works just as well with Zola. The only thing it doesn't cover is hidden sections.
from zola.
I came across this feature request, and this is exactly what I was hoping for. I am 48 hours into using zola, and I am really enjoying it. I have some experience with some other static site generators, so I am not a completely new to this.
I really like the idea of the hidden
flag. I think I have seen it in other generators that I have used. I was expecting the in_search_index
to behave like what is being propose here. I was sad to see that it was not that.
My use case is simple. I like to do my documentation in markdown -- as most of us that would be using this tool. I would like to create documentation, host it on my site, and choose who can have a link to it. It is kinda like a gist that is hosted on my domain.
@Keats -- I saw that you think this is rather niche, and I agree that many might not be using it. However, I want to provide my attempt to warm you up to accepting a PR if I provide one.
The following is an example of how I might want to use this. Notice that I am obfuscating the URL to make it harder to guess.
+++
title = "First Private Page"
slug = "m3SrhoqK"
date = 2024-02-04
hidden = true
+++
# Private Page
This is my first private page.
from zola.
Looks like it's not that niche!
How does it work for sections? Hidden sections implies all hidden pages with no way to un hide them?
from zola.
Hey @Keats,
I'd like to highlight that there's currently support for route-based protection in some static hostings. For instance, Azure Static Web Apps offers the ability to secure routes with roles. I believe platforms like Netlify and Vercel may also have similar features.
It would be great if content within protected routes doesn't get exposed in public links, such as sitemaps, search indexes, or atom feeds.
This functionality also allows us to seamlessly include both public and private content on the same website without worrying about unauthorized access.
from zola.
Well you would have to use that new hidden
field and map that with your host if needed
from zola.
Yes I understand Zola shouldn't worry about config the cloud hosting, just want to highligh that some clouds support route-based protection. I think the use-case is popular enough that Microsoft decided to supports it for a long time already.
This feature, if being implemented, will enable us to utilize that feature nicely, i.e. if I decide to protect a route in the host, all I need to do from zola side is set the route to hidden and it will be out of the world's knowledge.
from zola.
Related Issues (20)
- next/previous pages are in the wrong order HOT 1
- [Feature Request] Include page date in the search index HOT 1
- Theme translations HOT 3
- Generated Atom/RSS feed is badly generated HOT 10
- Non-default language search index doesn't respect `[search]` config HOT 1
- Feature Request: Auto redirect to default_language HOT 3
- zola check: checking vs checked link number does not match HOT 1
- Anyone compiling on Android? HOT 1
- How to use sort_by to Sort taxonomies in taxonomy_list.html? HOT 6
- Sintax highlighting of `?Sized` rust code is invalid HOT 1
- Internal anchors can be added by templates HOT 1
- support treating standalone .html files as pages HOT 4
- JPEG XL support for image processing? HOT 5
- Improve documentation about enabling Sass
- `zola serve` with `--output-dir` stopped serving assets in v0.18.0 HOT 7
- PR Question - Docs Contributions HOT 6
- Incorrect Plist syntax: UnexpectedXmlCharactersExpectedElement (offset 56) HOT 2
- `zola serve` treats `_` and `-` as equivalent for static assets, other static web servers do not. HOT 1
- `resize_image` default compression parameters for PNG often make files larger HOT 1
- Excerpt separator not compatible with Hugo (or Jekyll), is `<!-- more -->` rather than `<!--more-->` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zola.