Display shared/featured projects - read-the-docs

I have a local readthedocs build serving documentation for a number of projects (on a private corporate network). Each developer can create their own project, but I need the generated docs to be visible to all users - whether signed in or not.
The public readthedocs has a "Featured Projects" section on the landing page, but I can't find anywhere enable this feature in the configuration.

Related

How to reset content of the developer portal

The Azure APIM developer portal (new one) has been edited and now some of the menues dont work.
Is it possible reset the content ?
I have tried the capture.bat (from another APIM instance) and generate.bat into the broken instance but it didnt appear to work - i even made changes to one of the jpg files in the scripts.v3/media directory but it didnt get changed in the portal when i ran generate.
I find the "run your own hosted developer portal" scenario confusing. I am unclear on:
where is the content held for the unpublished managed portal ?
where is the content held for the published managed portal ?
where is the content held for the unpublished "own hosted" portal ?
ie when running locally (npm start on the Github repo code)
where is the content held for the published "own hosted" portal ?
When developing on a self hosted scenario, ideally i think it would be benefitial to hold the content locally so that it could be placed in source control. Failing that, is it possible to customise such that the "run your own hosted developer portal" content is in an accessible location such as a blob in a container on the same storage account that the code is being published to? That way I could copy content from an unbroken APIM into a storage account and develop with that.
Is it possible reset the content ?
Yes. Have you actually tried the simplest solution?
Open developer portal in edit mode:
Click reset content
where is the content held for the unpublished managed portal ?
where is the content held for the published managed portal ?
Same place - in the APIM resources. When you edit developer portal and you save it,
other users won't see those changes until you click publish.
You can also use developer portal revisions, from REST API or directly from Azure Portal. This will give you an opportunity to go back to previous revisions. So if you are publishing manually, after you edit and save developer portal I recommend to go to the revisions tab in azure portal and publish it from there - this way you will have simple version control.
For managed version, important thing to understand is, "content" consists of:
content types and content items which are just json template files describing your pages on developer portal. Those can be accessed by REST API here and here (this is a parent child relation).
and your uploaded custom media (images, fonts etc.) that can be retrieved from APIM Blob Storage. To get SAS URL for APIM Blob Storage and connect to it, just call your APIM Management API with address POST /portalSettings/mediaContent/listSecrets/ - this URL is not documented but you can call it like any other endpoint.
And that's it. That's all you need - json file and media files. The rest is managed for you. And in fact that's what those scripts from github repository are doing. capture.bat for example is downloading all the media and json from developer portal and saves it to your local folder. So you can for example save it to source control or/and upload to another APIM developer portal instance.
When managed developer portal and online editor is not enough for you and you need more customization, like custom widgets etc., you can go with self hosted version. It gives you more freedom but the downside of course is you are responsible for its upgrades.
where is the content held for the unpublished "own hosted" portal ? ie
when running locally (npm start on the Github repo code)
When you run npm start it just runs locally like when you develop any other webpage. In this case it uses webpack-dev-server to host the page.
where is the content held for the published "own hosted" portal ?
Wherever you feel like it. That's the idea behind the self-hosted version. After you are happy with the changes you've made, just run npm run publish and files will appear in dist folder. Then you can upload them to the resource of your choice. This tutorial shows you how to enable hosting of static websites for your blob storage and host your developer portal there. Everything is explained, just follow the article carefully step by step (don't skip any step, every single one is important in order to successfully configure and deploy your self-hosted developer portal). Good luck.

How to host my own website with my own html documents

I know this is the most basic of questions. I made my own website in HTML documents. I bought a domain name from google. How can I publish this, how can I host it? I don't want to use any website creator, I want to publish my own files that I worked on.
You can use Github to host your website on your own domain.
You have to add the whole files needed for the website. Then in the settings of your repo use the Github pages feature and enable it. Change the source of Github pages to host in your own domain. Then you have to add some A and CNAME records of your domain to point to github servers.
Here are the full steps for the process - https://www.geeksforgeeks.org/publish-websites-on-github-pages-with-a-custom-domain/

How to block access to a static site?

I will host a static site (just a few pages actually) on Netlify, a cloud hosting provider. It would be my notes and may have sensitive code and API keys. I want it set up so that only I can access this site from internet and no one else. How can I block access to the static site for others?
Alternately, if I do the same with with Github Pages, is it possible to restrict access there?
You need an access control mechanism to protect your notes.
If you are running the web server doing the hosting, most web server programs (Apache and nginx are the two most popular) have built-in access control mechanisms, see link given by Carsten H or see Access Control with Apache or How to Set Up Password Authentication with Nginx (Digital Ocean guide).
If you are using Github Pages, it is possible to do access control, but a bit more tricky. You can create a Github OAuth application and ask people to authenticate using your Github OAuth app. The app will ask for their username, and check if that username matches a list of allowed Github users (probably just your Github username). If the usernames match, static content is served up, otherwise the user is redirected to a 403 forbidden page.
Also see the github-heroku-attack-rabbits project page for details of how to create the Flask app mentioned above (using flask-dance to authenticate users via your Github OAuth app). The Flask app can be hosted for free on Heroku.
Two more things to note regarding public/private repos:
If you are using Github Pages, the repository containing your notes will need to be private, otherwise the contents of your notes will be in a public repository (even if the Github Pages static page has an access control layer).
Just because a repo is private does NOT mean its Github Pages page is private. By default, a private repo's Github Pages page is accessible/readable by the public. It is up to you to put an access control mechanism in place to protect the page.
You can try the encryption route. Here, the name staticrypt really says everything (I have a demo here). It allows you to create a password for each page for your website. It used AES-256 encryption, so as far as I am concerned, a long password should suffice.
If you don't share the password, you will be the only one to view the webpage.
These are actually two questions and is good practice to ask them individually.
This is a frequently asked question and depends on your server, e.g. for Apache you can edit your .htaccess following this instructions
you need to create a private repository by checking the private repository option during the repository creation

How to link my Google Domain to a custom HTML webpage

My team and I have recently purchased a Google Domain, but when trying to have the website it is connected to, it only gives us the options of website builders. We have a GitHub repository with all of our files that we want it to host, but again, only website builders. Can I make my Google Domain connect to a custom HTML page?
You can host your content on GitHub and serve them with GitHub Pages
https://pages.github.com
You can have your Google Domains domain point to it.
https://help.github.com/articles/using-a-custom-domain-with-github-pages/
You'll need to add a CNAME file to your repo with your domain URL in it. Add it manually or follow the instructions here.
https://help.github.com/articles/adding-or-removing-a-custom-domain-for-your-github-pages-site/
You'll need to add some A records at the Google Domains control panel with the IP addresses of GitHub's servers (currently 192.30.252.153 and 192.30.252.154).
https://support.google.com/domains/answer/3290350?hl=en

Can I create more than one repository for github pages?

I created a repository for hosting a blog on github.Is there any way that I can create more to host multiple blogs?Am I limited to just one repository for hosting(since username.github.com can only be used once?)
You can have one site published to https://<username>.github.io by publishing to the master branch of a repository named “username.github.io” (substituting your actual username).
You can also have an additional site per GitHub project published to https://<username>.github.io/<project>. Project settings let you choose which branch and directory to publish.
A better description is available in the GitHub Pages documentation, including options for using custom domain names.
(since April 2013, all username.github.com are now username.github.io)
No you are not limited, it is possible to have multiple GitHub Pages sites within one account. Create another GitHub repository and push your site files to the gh-pages branch. This would result in the site being hosted at tshepang.github.io/repo-name
Now, push another file "CNAME" to the same repository and branch and fill it with movies.tshepang.net. Log in to your DNS host and add the CNAME to point to "tshepang.github.io" (just like the original site).
This would allow you to have seemingly two different sites on different domains. This would not work for having two or more sub-domains within github.io itself.
There is a possibility to host multiple pages within the same repository having sub-pages if you are fine with code duplication.
The latest version of my website is hosted on http://username.github.io/REPONAME
This is a screenshot of the structure of my root repository where I host the latest version of my website:
Inside folder "2.4.0" I can host a previous version of the same page ,which is then reachable at: http://username.github.io/REPONAME/2.4.0
This is the structure of the folder 2.4.0:
Using this methodology of sub-pages within a main page, you can host multiple sub-pages within one main page.
You can only create one user or organization site for each GitHub account. Project sites, whether owned by an organization or a user account, are unlimited.
GitHub Pages sites
There are three types of GitHub Pages sites: project, user, and organization. Project sites are connected to a specific project hosted on GitHub, such as a JavaScript library or a recipe collection. User and organization sites are connected to a specific GitHub account.
To publish a user site, you must create a repository owned by your user account that's named <user>.github.io. To publish an organization site, you must create a repository owned by an organization that's named <organization>.github.io. Unless you're using a custom domain, user and organization sites are available at http(s)://<username>.github.io or http(s)://<organization>.github.io.
The source files for a project site are stored in the same repository as their project. Unless you're using a custom domain, project sites are available at http(s)://<user>.github.io/<repository> or http(s)://<organization>.github.io/<repository>.
The publishing source for your GitHub Pages site is the branch and folder where the source files for your site are stored. If the default publishing source exists in your repository, GitHub Pages will automatically publish a site from that source. The default publishing source for user and organization sites is the root of the default branch for the repository. The default publishing source for project sites is the root of the gh-pages branch.
I found a workaround if you don't want to make separate repositories for your different sites but just want to host them. In your io repo, create an index.html file on your master branch that acts as a table of contents linking to your other sites(subDirectories) index.html files. The username.github.io master branch seems to be the landing page that enables the hosting, so if it doesn't see an index file linking out to your separate projects, it won't register your subdirectories. After this all you need is the URL to whatever project you want to view. The io basically behaves like a giant single website with all your separate projects on it. Of course, if you would rather have separate repositories, gh-pages is the way to go.
Today I created another site and rather than creating branch gh-pages I have configured the master branch in a repository setting --> GitHub pages section select Source as master (or any other branch you want). You will get site link in the same section, in my screen shot I have removed site link.
This works, but ssl is still something I need to figure.
In my case GoDaddy is where my domains rest (url1.xyz), with nameservers pointing to Cloudflare. Then in Cloudflare the A records points to Github Pages. This is website 1 live, running fine. For website 2 I create a subdirectly in my gh-pages repo with website 2 files e.g. url1.xyz/static/website2/ - Then I create a subdomain in Cloudflare (subdomain.url1.xyz). Then create a page rule (url forward) from the subdomain to the subdirectory containing the 2nd website e.g. subdomain.url1.xyz >> mask forward >> url1.xyz/static/website2/ .. Then in GoDaddy I can configure url2.co.uk to mask forward to subdomain.url1.xyz , which presents website 2 e.g. url1.xyz/static/website2/
Just to add to the above. With one github user account(https://< username >.github.io) we can still have multiple static content websites hosted with different custom domains (Eg: domain1.com, domain2.com, domain3.com)We can just create a new repository for each domain and point the A record to github pages IP and CNAME record to < username >.github.io
You can create multiple blogs in your github account.
One repository can be created under your username. Push your code to branch gh-pages and you can see the site on <username>.github.io
Another one can be created under your organisation. For this you will have to create your organization first. Create a new repository under this organisation and push your code to gh-pages. You can see your site on <organization-name>.github.io
You can also create for each of your project and the site will be available on <username>.github.io/<repository>
Please refer this for more information on github pages.