Repository navigation
Serving Pages
In Profile Server, a page is any document with content you want to serve.
To create a page, just create a markdown file (Only files with extension md are considered for page creation). The markdown file needs some metadata to be served. These are the necessary metadata and the default value they take.
-
title: The title of the page. Default: filename -
permalink: The permanent link to the page. Default: relative path frompages_diretory -
date: Date of publishing. Default: date of access -
paper_url: Any paper you want to link. Default: null -
excerpt: Excerpt of your page. Default: null
If you don't want to use your own values for these parameters, add them as metadata at the starting of your markdown file as shown below
---
pagemeta
<your_metadata>
---
<content_goes_here>
---
pagemeta
title: Sample Page
collections: publications
permalink: /somepath/somepage
excerpt: This is a link to GitHub
date: 16-03-2018
---
# This is my first heading
This is some content
[Github](https://github.com)
You can access the pages you create at http://localhost:8080/<permalink>. For the sample page shown, the url would be http://localhost:8080/somepath/somepage
The response to http://localhost:8080/<permalink> will be in the following format:
{
"is_page": true,
"children": [],
"page": {
"permalink": "<permalink>",
"title": "<page_title>",
"date": "<date>",
"paper_url": "<paper_url>",
"content_md": "<content_of_page_in_markdown>",
"content_html": "<content_of_page_in_html>",
"excerpt": "<excerpt>",
"collections": null,
"page_venue": null
}
}
Hitting any valid URL which is not a page, but a part of the permalink to the page will show all the next steps available in the path.
Consider the example shown above. The permalink for that page was /somepath/somepage. Now, hitting the url http://localhost:8080/somepath will show all the next steps available for that path.
The response for http://localhost:8080/somepath will be
{
"is_page": false,
"children": [
"somepath/somepage"
],
"page": null
}
To get all the base paths available, hit the url http://localhost:8080/routes. Response format:
[
<list_of_all_base_paths>
]
When a page (or directory) is created, updated or deleted, the server will detect it and make the necessary changes to the URL routes without restart being necessary.