Move static assets from public/ to static/ for clearer structure

This commit is contained in:
Michael Mayer 2019-05-22 13:55:11 +02:00
parent 2d085586cb
commit d31305a503
15 changed files with 28 additions and 28 deletions

View file

@ -4,7 +4,7 @@
/internal/photoprism/testdata/*
/frontend/node_modules/*
/node_modules
/assets/server/public/build/*
/assets/server/static/build/*
/assets/testdata
/assets/backups
/assets/tensorflow/nasnet
@ -15,4 +15,4 @@ docker-compose*
.dockerignore
.idea
.DS_Store
/frontend/tests/acceptance/screenshots
/frontend/tests/acceptance/screenshots

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 510 KiB

After

Width:  |  Height:  |  Size: 510 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 127 KiB

View file

@ -3,7 +3,7 @@
"name": "PhotoPrism: Browse your life in pictures",
"icons": [
{
"src": "/assets/favicons/favicon.png",
"src": "/static/favicons/favicon.png",
"sizes": "723x729",
"type": "image/png"
}

View file

@ -25,11 +25,11 @@
content="Personal photo management powered by Go and Google TensorFlow. Free and open-source. Made with ❤️ in Berlin."/>
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/assets/favicons/favicon.png">
<link rel="icon" type="image/png" href="/assets/favicons/favicon.png"/>
<link rel="apple-touch-icon" href="/static/favicons/favicon.png">
<link rel="icon" type="image/png" href="/static/favicons/favicon.png"/>
<link rel="stylesheet" href="/assets/build/app.css?{{ .cssHash }}">
<link rel="manifest" href="/assets/manifest.json">
<link rel="stylesheet" href="/static/build/app.css?{{ .cssHash }}">
<link rel="manifest" href="/static/manifest.json">
<script>
window.appConfig = {
@ -61,6 +61,6 @@
</div>
</div>
<script src="/assets/build/app.js?{{ .jsHash }}"></script>
<script src="/static/build/app.js?{{ .jsHash }}"></script>
</body>
</html>

View file

@ -22,7 +22,7 @@
<v-list>
<v-list-tile class="p-navigation-logo">
<v-list-tile-avatar>
<img src="/assets/img/logo.png">
<img src="/static/img/logo.png">
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title class="title">

View file

@ -7,7 +7,7 @@
<v-layout row wrap justify-center class="px-4 py-5">
<v-flex md8 xs12>
<v-card dark flat>
<v-img src="/assets/img/tagcloud.jpg" aspect-ratio="1" class="mb-5 mx-5"></v-img>
<v-img src="/static/img/tagcloud.jpg" aspect-ratio="1" class="mb-5 mx-5"></v-img>
</v-card>
</v-flex>
<v-flex md4 xs12>

View file

@ -156,7 +156,7 @@
<v-container fluid v-if="query.view === 'cloud'">
<v-layout justify-space-around>
<v-flex>
<v-img src="/assets/img/tagcloud.jpg" aspect-ratio="1.7" @click.stop="dialog = true"></v-img>
<v-img src="/static/img/tagcloud.jpg" aspect-ratio="1.7" @click.stop="dialog = true"></v-img>
</v-flex>
</v-layout>
</v-container>

View file

@ -8,7 +8,7 @@ const PATHS = {
app: path.join(__dirname, "src/app.js"),
js: path.join(__dirname, "src"),
css: path.join(__dirname, "src/css"),
build: path.join(__dirname, "../assets/server/public/build"),
build: path.join(__dirname, "../assets/server/static/build"),
};
const isDev = process.env.NODE_ENV !== "production";
@ -172,7 +172,7 @@ const config = {
loader: "file-loader",
options: {
name: "[hash].[ext]",
publicPath: "/assets/build/img",
publicPath: "/static/build/img",
outputPath: "img",
},
},
@ -181,7 +181,7 @@ const config = {
loader: "file-loader",
options: {
name: "[hash].[ext]",
publicPath: "/assets/build/fonts",
publicPath: "/static/build/fonts",
outputPath: "fonts",
},
},

View file

@ -47,8 +47,8 @@ func configAction(ctx *cli.Context) error {
fmt.Printf("tf-model-path %s\n", conf.TensorFlowModelPath())
fmt.Printf("templates-path %s\n", conf.HttpTemplatesPath())
fmt.Printf("favicons-path %s\n", conf.HttpFaviconsPath())
fmt.Printf("public-path %s\n", conf.HttpPublicPath())
fmt.Printf("public-build-path %s\n", conf.HttpPublicBuildPath())
fmt.Printf("static-path %s\n", conf.HttpStaticPath())
fmt.Printf("static-build-path %s\n", conf.HttpStaticBuildPath())
fmt.Printf("darktable-cli %s\n", conf.DarktableCli())

View file

@ -75,7 +75,7 @@ func (c *Config) CreateDirectories() error {
return err
}
if err := os.MkdirAll(c.HttpPublicBuildPath(), os.ModePerm); err != nil {
if err := os.MkdirAll(c.HttpStaticBuildPath(), os.ModePerm); err != nil {
return err
}
@ -296,7 +296,7 @@ func (c *Config) TensorFlowModelPath() string {
return c.AssetsPath() + "/tensorflow"
}
// ServerPath returns the server assets path (public files, favicons, templates,...).
// ServerPath returns the server assets path (static files, templates,...).
func (c *Config) ServerPath() string {
return c.AssetsPath() + "/server"
}
@ -308,17 +308,17 @@ func (c *Config) HttpTemplatesPath() string {
// HttpFaviconsPath returns the favicons path.
func (c *Config) HttpFaviconsPath() string {
return c.HttpPublicPath() + "/favicons"
return c.HttpStaticPath() + "/favicons"
}
// HttpPublicPath returns the public server path (//server/assets/*).
func (c *Config) HttpPublicPath() string {
return c.ServerPath() + "/public"
// HttpStaticPath returns the static server assets path (//server/static/*).
func (c *Config) HttpStaticPath() string {
return c.ServerPath() + "/static"
}
// HttpPublicBuildPath returns the public build path (//server/assets/build/*).
func (c *Config) HttpPublicBuildPath() string {
return c.HttpPublicPath() + "/build"
// HttpStaticBuildPath returns the static build path (//server/static/build/*).
func (c *Config) HttpStaticBuildPath() string {
return c.HttpStaticPath() + "/build"
}
// Db returns the db connection.
@ -379,8 +379,8 @@ func (c *Config) ClientConfig() ClientConfig {
db.Where("deleted_at IS NULL").Limit(1000).Order("camera_model").Find(&cameras)
jsHash := util.Hash(c.HttpPublicBuildPath() + "/app.js")
cssHash := util.Hash(c.HttpPublicBuildPath() + "/app.css")
jsHash := util.Hash(c.HttpStaticBuildPath() + "/app.js")
cssHash := util.Hash(c.HttpStaticBuildPath() + "/app.css")
result := ClientConfig{
"name": c.Name(),

View file

@ -13,7 +13,7 @@ func registerRoutes(router *gin.Engine, conf *config.Config) {
router.StaticFile("/favicon.ico", conf.HttpFaviconsPath()+"/favicon.ico")
// Static assets like js and css files
router.Static("/assets", conf.HttpPublicPath())
router.Static("/static", conf.HttpStaticPath())
// JSON-REST API Version 1
v1 := router.Group("/api/v1")