mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	chore(share): basic integration of CSS
This commit is contained in:
		
							parent
							
								
									881a015f68
								
							
						
					
					
						commit
						9469433143
					
				@ -18,6 +18,7 @@ import utils, { isDev, safeExtractMessageAndStackFromError } from "../services/u
 | 
				
			|||||||
import options from "../services/options.js";
 | 
					import options from "../services/options.js";
 | 
				
			||||||
import { t } from "i18next";
 | 
					import { t } from "i18next";
 | 
				
			||||||
import shareThemeRoot from "@triliumnext/share-theme/templates/page.ejs";
 | 
					import shareThemeRoot from "@triliumnext/share-theme/templates/page.ejs";
 | 
				
			||||||
 | 
					import shareThemeCss from "@triliumnext/share-theme/styles.css";
 | 
				
			||||||
import ejs from "ejs";
 | 
					import ejs from "ejs";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function getSharedSubTreeRoot(note: SNote): { note?: SNote; branch?: SBranch } {
 | 
					function getSharedSubTreeRoot(note: SNote): { note?: SNote; branch?: SBranch } {
 | 
				
			||||||
@ -212,7 +213,10 @@ function register(router: Router) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (useDefaultView) {
 | 
					        if (useDefaultView) {
 | 
				
			||||||
            console.log("Got share theme path", shareThemeRoot);
 | 
					            console.log("Got share theme path", shareThemeRoot);
 | 
				
			||||||
            const ejsResult = ejs.render(shareThemeRoot, opts, {
 | 
					            const ejsResult = ejs.render(shareThemeRoot, {
 | 
				
			||||||
 | 
					                shareThemeCss,
 | 
				
			||||||
 | 
					                ...opts
 | 
				
			||||||
 | 
					            }, {
 | 
				
			||||||
                includer(originalPath, parsedPath: string) {
 | 
					                includer(originalPath, parsedPath: string) {
 | 
				
			||||||
                    console.log("Path ", originalPath, parsedPath);
 | 
					                    console.log("Path ", originalPath, parsedPath);
 | 
				
			||||||
                    throw new Error("Hi");
 | 
					                    throw new Error("Hi");
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										5
									
								
								apps/server/src/types.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								apps/server/src/types.d.ts
									
									
									
									
										vendored
									
									
								
							@ -33,3 +33,8 @@ declare module "@triliumnext/share-theme/*.ejs" {
 | 
				
			|||||||
    const content: string;
 | 
					    const content: string;
 | 
				
			||||||
    export default content;
 | 
					    export default content;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					declare module "@triliumnext/share-theme/styles.css" {
 | 
				
			||||||
 | 
					    const content: string;
 | 
				
			||||||
 | 
					    export default content;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -13,7 +13,8 @@
 | 
				
			|||||||
    "test": "esrun src/scripts/test.ts"
 | 
					    "test": "esrun src/scripts/test.ts"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "exports": {
 | 
					  "exports": {
 | 
				
			||||||
    "./*": "./src/*"
 | 
					    "./templates/*": "./src/templates/*",
 | 
				
			||||||
 | 
					    "./*": "./dist/*"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "author": "",
 | 
					  "author": "",
 | 
				
			||||||
  "license": "ISC",
 | 
					  "license": "ISC",
 | 
				
			||||||
 | 
				
			|||||||
@ -56,6 +56,9 @@ const customServerYml = `- url: "{protocol}://{domain}:{port}/etapi"
 | 
				
			|||||||
    <% if (note.hasLabel("shareDisallowRobotIndexing")) { %>
 | 
					    <% if (note.hasLabel("shareDisallowRobotIndexing")) { %>
 | 
				
			||||||
        <meta name="robots" content="noindex,follow" />
 | 
					        <meta name="robots" content="noindex,follow" />
 | 
				
			||||||
    <% } %>
 | 
					    <% } %>
 | 
				
			||||||
 | 
					    <style>
 | 
				
			||||||
 | 
					        <%= shareThemeCss %>
 | 
				
			||||||
 | 
					    </style>
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    <%
 | 
					    <%
 | 
				
			||||||
        const pageTitle = `${note.title}${note.noteId !== subRoot.note.noteId ? ` - ${subRoot.note.title}` : ""}`;
 | 
					        const pageTitle = `${note.title}${note.noteId !== subRoot.note.noteId ? ` - ${subRoot.note.title}` : ""}`;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user