Add tag overview, improve assets
This commit is contained in:
@ -2,11 +2,6 @@ import Foundation
|
||||
|
||||
final class PageSettings: ObservableObject {
|
||||
|
||||
/// The prefix of the urls for all pages
|
||||
/// The full path will be `<pagePrefix>/<page-url-component>`
|
||||
@Published
|
||||
var pageUrlPrefix: String
|
||||
|
||||
@Published
|
||||
var contentWidth: Int
|
||||
|
||||
@ -17,13 +12,39 @@ final class PageSettings: ObservableObject {
|
||||
var pageLinkImageSize: Int
|
||||
|
||||
@Published
|
||||
var javascriptFilesPath: String
|
||||
var defaultCssFile: FileResource?
|
||||
|
||||
init(file: PageSettingsFile) {
|
||||
self.pageUrlPrefix = file.pageUrlPrefix
|
||||
@Published
|
||||
var codeHighlightingJsFile: FileResource?
|
||||
|
||||
@Published
|
||||
var audioPlayerJsFile: FileResource?
|
||||
|
||||
@Published
|
||||
var audioPlayerCssFile: FileResource?
|
||||
|
||||
@Published
|
||||
var modelViewerJsFile: FileResource?
|
||||
|
||||
init(file: PageSettingsFile, files: [String : FileResource]) {
|
||||
self.contentWidth = file.contentWidth
|
||||
self.largeImageWidth = file.largeImageWidth
|
||||
self.pageLinkImageSize = file.pageLinkImageSize
|
||||
self.javascriptFilesPath = file.javascriptFilesPath
|
||||
self.defaultCssFile = file.defaultCssFile.map { files[$0] }
|
||||
self.codeHighlightingJsFile = file.codeHighlightingJsFile.map { files[$0] }
|
||||
self.audioPlayerJsFile = file.audioPlayerJsFile.map { files[$0] }
|
||||
self.audioPlayerCssFile = file.audioPlayerCssFile.map { files[$0] }
|
||||
self.modelViewerJsFile = file.modelViewerJsFile.map { files[$0] }
|
||||
}
|
||||
|
||||
var file: PageSettingsFile {
|
||||
.init(contentWidth: contentWidth,
|
||||
largeImageWidth: largeImageWidth,
|
||||
pageLinkImageSize: pageLinkImageSize,
|
||||
defaultCssFile: defaultCssFile?.id,
|
||||
codeHighlightingJsFile: codeHighlightingJsFile?.id,
|
||||
audioPlayerJsFile: audioPlayerJsFile?.id,
|
||||
audioPlayerCssFile: audioPlayerJsFile?.id,
|
||||
modelViewerJsFile: modelViewerJsFile?.id)
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,9 @@ final class PathSettings: ObservableObject {
|
||||
@Published
|
||||
var outputDirectoryPath: String
|
||||
|
||||
@Published
|
||||
var assetsOutputFolderPath: String
|
||||
|
||||
@Published
|
||||
var pagesOutputFolderPath: String
|
||||
|
||||
@ -21,6 +24,7 @@ final class PathSettings: ObservableObject {
|
||||
var tagsOutputFolderPath: String
|
||||
|
||||
init(file: PathSettingsFile) {
|
||||
self.assetsOutputFolderPath = file.assetsOutputFolderPath
|
||||
self.outputDirectoryPath = file.outputDirectoryPath
|
||||
self.pagesOutputFolderPath = file.pagesOutputFolderPath
|
||||
self.imagesOutputFolderPath = file.imagesOutputFolderPath
|
||||
@ -28,4 +32,14 @@ final class PathSettings: ObservableObject {
|
||||
self.videosOutputFolderPath = file.videosOutputFolderPath
|
||||
self.tagsOutputFolderPath = file.tagsOutputFolderPath
|
||||
}
|
||||
|
||||
var file: PathSettingsFile {
|
||||
.init(outputDirectoryPath: outputDirectoryPath,
|
||||
assetsOutputFolderPath: assetsOutputFolderPath,
|
||||
pagesOutputFolderPath: pagesOutputFolderPath,
|
||||
imagesOutputFolderPath: imagesOutputFolderPath,
|
||||
filesOutputFolderPath: filesOutputFolderPath,
|
||||
videosOutputFolderPath: videosOutputFolderPath,
|
||||
tagsOutputFolderPath: tagsOutputFolderPath)
|
||||
}
|
||||
}
|
||||
|
@ -10,13 +10,32 @@ final class PostSettings: ObservableObject {
|
||||
@Published
|
||||
var contentWidth: Int
|
||||
|
||||
init(postsPerPage: Int, contentWidth: Int) {
|
||||
@Published
|
||||
var swiperCssFile: FileResource?
|
||||
|
||||
@Published
|
||||
var swiperJsFile: FileResource?
|
||||
|
||||
@Published
|
||||
var defaultCssFile: FileResource?
|
||||
|
||||
init(postsPerPage: Int,
|
||||
contentWidth: Int,
|
||||
swiperCssFile: FileResource?,
|
||||
swiperJsFile: FileResource?,
|
||||
defaultCssFile: FileResource?) {
|
||||
self.postsPerPage = postsPerPage
|
||||
self.contentWidth = contentWidth
|
||||
self.swiperCssFile = swiperCssFile
|
||||
self.swiperJsFile = swiperJsFile
|
||||
self.defaultCssFile = defaultCssFile
|
||||
}
|
||||
|
||||
init(file: PostSettingsFile) {
|
||||
init(file: PostSettingsFile, files: [String : FileResource]) {
|
||||
self.postsPerPage = file.postsPerPage
|
||||
self.contentWidth = file.contentWidth
|
||||
self.swiperCssFile = file.swiperCssFile.map { files[$0] }
|
||||
self.swiperJsFile = file.swiperJsFile.map { files[$0] }
|
||||
self.defaultCssFile = file.defaultCssFile.map { files[$0] }
|
||||
}
|
||||
}
|
||||
|
@ -5,9 +5,9 @@ final class Settings: ObservableObject {
|
||||
@Published
|
||||
var paths: PathSettings
|
||||
|
||||
/// The tags to show in the navigation bar
|
||||
/// The items to show in the navigation bar
|
||||
@Published
|
||||
var navigationTags: [Tag]
|
||||
var navigationItems: [Item]
|
||||
|
||||
@Published
|
||||
var posts: PostSettings
|
||||
@ -21,9 +21,9 @@ final class Settings: ObservableObject {
|
||||
@Published
|
||||
var english: LocalizedPostSettings
|
||||
|
||||
init(paths: PathSettings, navigationTags: [Tag], posts: PostSettings, pages: PageSettings, german: LocalizedPostSettings, english: LocalizedPostSettings) {
|
||||
init(paths: PathSettings, navigationItems: [Item], posts: PostSettings, pages: PageSettings, german: LocalizedPostSettings, english: LocalizedPostSettings) {
|
||||
self.paths = paths
|
||||
self.navigationTags = navigationTags
|
||||
self.navigationItems = navigationItems
|
||||
self.posts = posts
|
||||
self.pages = pages
|
||||
self.german = german
|
||||
|
Reference in New Issue
Block a user