I have some .md files that are happily built into articles of a site generated by docfx.
The landing page of this site which at the moment is a index.md file is empty.
I have a separate static html page that its content is rendered by javascript containing some graph etc.
What I would like to do is to render this html content as the landing page of the docfx site.
How do I do that?
Any help is much appreciated.
Thanks.
If I understand your use case, this worked for me:
Add index.html at root. This is your HTML landing page.
Reference index.html in the resource object in docfx.json:
"resource": [
{
"files": [
"articles/**/media/**",
"index.html"
]
Reference index.html in toc.yml at root:
- name: Home
homepage: index.html
Make sure you delete the previous site output directory (_site by default) before testing this new configuration.
I would expect there is a more sophisticated way but maybe this can get you started.
Related
I need to convert a non-nextjs page to nextjs. In order to not lose my SEO ranking, I have to create the route with html extension. To make the picture look better, I am adding the folder structure down below.
Unfortunately, this route ending up as 404 on the browser.
What is the problem? Am I allowed to use Next.js routes like that with html extension?
You can do this via the pageExtensions option in nextJS -
I deployed a vercel app to show how this is working
https://html-ext.vercel.app/search-results.html
Steps
Add the pageExtensions to next.config.js files
i.e
pageExtensions: ['html', 'jsx', 'js', 'tsx', 'ts'],
Rename the file under pages directory to .html.js - search-results.html.js in this case.
This naming convention search-result.html is not allowed for public sub-directories .
There are some ways of showing html file in next but I'm not sure they will workcheck this
But you can easily copy everything inside your <body> tag inside your Next js project and it will work properly . How ever you have to manually add your <meta> and other head tags inside Next js built in <Head/> component .
When I open dynamic page first time in Nuxtjs it works fine but when I reload this page manually all of css and js files stop working and page breaks. When I open these styling and js files in browser from its page source, it shows " /* style not found */ " Can anyone guide me why its happening and what is its solution. My app's mode in universal.
This is my nuxt.config.js file ... these files in script tag are located in static/assets folder:
This is my issue:
This is happening because path for pages/project/id page is one directory up for static folder files but direct path for pages/ViewProject file .... I just don't know how I can make path same for all nested as well as direct pages. Can anyone guide me about this ?
After spending a lot of time searching on internet for solutions, finally I figured one solution. Posting it here so it may help anyone and saves anyone's time. So to make nuxt to not modify script paths by adding prefixes I included script src in head object of nuxt.config.js this way :
import { join } from 'path'
export default {
head: {
script: [
{
src: join('/', `assets/plugins/global/plugins.bundle.js`),
body: true
}
]
}
This way now either from nested pages or direct pages under directory pages directory, script are loaded correctly.
I am working on an angular js 1.x application by using ui-router and have come up with a bottleneck since I am new to angular js ,so please forgive me if I sound silly.
Problem:
I have a main angular js app which has its own css files and script files(controllers,directives 3rd party libraries like bootstrap,angular etc and services files).
Now I have a landing page which has its separate design(it has its own css,scripts and images files).
Now I want to integrate the above mentioned landing page with its own separate files on the root route of the angular js app.
So my question is how should I do that ? , so that the css and scripts files don't conflict with each when I try to visit landing page and the route for the main application back forth.
I have tried oclazyloading the required files for landing page state and the main apps files respectively but they seem to conflict with each other's files.Since from what I think is happening is that the files that are already lazily loaded for the landing page conflicts with the files lazily loaded for the main app when I click on the main app link on the landing page.
Edit 1:
I also tried using angular-ui-router-styles it does the job since it unloads all the lazily loaded files before adding new files but what happens is that on page reload unstyled page occurs and then after few seconds it gets style because the package loads the css files after appending it in head tag
Suppose you have index.html in which you have to insert one page then your body section should be like this
<body>
<div>
<ui-view></ui-view>
</div>
</body>.
Now in your controller file suppose index.js your code should be like this
var myApp=angular.module("myModule",["ui.router"])
.config(function($stateProvider,$urlRouterProvider){
$urlRouterProvider.otherwise("/home");
$stateProvider
.state("homePage",{
url:"/home",
templateUrl:"site/homepage.html",
controller:"homePageController as homePageCtrl"
})
.state("Dashboard",{
url:"/dashboard",
templateUrl:"site/dashboard.html",
controller:"DashboardController as homePageCtrl"
})
)}
Explanation:
you have to inject $urlRouterProvider service in your config to make by default route to specific state.
in this example we make`
$urlRouterProvider.otherwise("/home");
so it will route to url "/home" which is url specified for homePage state.
So it will load respective html page of that state i.e homePage.html.
if you want other static page to be your default page when your project is loaded,just specify its url in $urlRouterProvider().
Don't forget to inject $urlRouterProvider service.
Also in your index.html add all your custom css files if it overrides the boootstrap css files then make sure that add your ids to your html and specify css for that.
Hope i have cleared your issues.
I did this by keeping the two projects completely separate. When I deploy the projects to my server, I put the Angular app into a sub-directory of the landing page project.
To do this, you need to tell the Angular app that it's running in a sub-directory, and not at the root of the site. At deploy time I have a gulp task modify the <base href="/"> tag in the Angular app's index.html so it looks like this: <base href="/sub-directory-name/">
I use the gulp task so that when I'm developing locally I can run the Angular app from the root, not the sub-directory.
Modifying the <base> tag means you won't have to change any of the URLs in your Angular app to reflect it's new location in the sub-directory.
Finally, my web server (nginx in my case), is configured to serve the landing page at the root, and the single page app from the sub directory.
I have an electron app with multiple html files in the root directory.
index.html
page1.html
page.html
I cannot find a way to redirect from index.html to page1.html once Electro has started.
Does anyone know how to do this?
When your first page is index.html you call that page, when you create your window.
const win = new BrowserWindow(options);
win.loadUrl(`file://${__dirname}/index.html`);
If you want to load another page maybe
win.loadUrl(`file://${__dirname}/page.html`);
could help you.
If the page should be loaded after a user action (e.g. click on a link). You can add the link to your index.hmtl page. Electron works here exactly like a browser.
Go to page
I'm using the default index.html located in RessourcesFolder of my app. The index.html page is only there to check if my application has an update (new html pages to display in app).
It works perfectly.. I can download my new contents from the server in applicationDataDirectory
But.. when I finished the application update, I'd like to replace the current index.html page with my updateindex.html
Loading remote html pages works fine, for example:
currentWindow.setURL('http://www.stackoverflow.com/' );
However, when I try something like
currentWindow.setURL('C:\Documents and Settings\myuser\Application Data\TideSDK\testApp\index_update.html' );
Nothing is appended..
Can anyone help me?
you can modify the path of which index page you want to load within your application
this can be modified within the tiapp.xml file. Replace "app://index.html" with "app://updateindex.html" and you should be good to go