Code Monkey home page Code Monkey logo

Comments (10)

RomainMazB avatar RomainMazB commented on May 28, 2024 1

@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.

mwcz avatar mwcz commented on May 28, 2024

draft already covers most of these needs, but I'm not sure if it can be used on sections.

from zola.

tuyen-at-work avatar tuyen-at-work commented on May 28, 2024

@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.

Keats avatar Keats commented on May 28, 2024

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.

mwcz avatar mwcz commented on May 28, 2024

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.

glhewett avatar glhewett commented on May 28, 2024

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.

Keats avatar Keats commented on May 28, 2024

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.

tuyen-at-work avatar tuyen-at-work commented on May 28, 2024

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.

Keats avatar Keats commented on May 28, 2024

Well you would have to use that new hidden field and map that with your host if needed

from zola.

tuyen-at-work avatar tuyen-at-work commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.