ojosproject / website

The Ojos Project website containing our blogs and documentation!
https://ojosproject.org/
GNU General Public License v3.0
0 stars 0 forks source link

Create a way to log visited pages #27

Closed calejvaldez closed 1 month ago

calejvaldez commented 2 months ago

Summary

It would be cool if we could log the pages people attempt to visit. We would only track the timestamp and the page. We do not need anything else except for that.

The reason for logging pages would be so that we can fight against link rot. The Ojos Project website is steadily becoming a big website, and we can easily lose track of the various pages we have made available with no redirects, which can lead to losing information and a worse user experience.

Not really a priority at the moment.

Concept images and/or code

visited_pages_log.json file concept:

[
    {
        "path": "/docs/url/getting-started/",
        "timestamp": 0
    },
    {
        "path": "/docs/url/",
        "timestamp": 10
    }
]

LogVisitedPage component:

export function LogVisitedPage(props: {path: string}) {
    useEffect(() => {
        // Create Unix timestamp
        // API call to logger
    }, []
}
calejvaldez commented 1 month ago

This might require some kind of backend or at least an API. Not sure if this is needed at the moment, though. Will close for now.