Skip to content

Instantly share code, notes, and snippets.

View lgdd's full-sized avatar

Louis-Guillaume Durand lgdd

View GitHub Profile
@lgdd
lgdd / release-multiple-java-versions.yml
Last active April 11, 2024 14:41
Google Release Please Action for a Liferay Workspace
# Settings > Actions > General > Read and write permissions
# Settings > Actions > General > Allow GitHub Actions to create and approve pull requests
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
@lgdd
lgdd / code.html
Last active March 12, 2024 17:01
Liferay DXP - Fragment Portlet Loader
[@liferay_portlet["runtime"]
portletName="${configuration.portletID}"
instanceId="${configuration.portletID}_instance_${fragmentElementId}"
/]
@lgdd
lgdd / custom_proxy.conf
Created February 29, 2024 14:14
Liferay PaaS - Proxy requests to custom http service
location /proxy {
proxy_pass http://customservice:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
rewrite ^/proxy/(.*)$ /$1 break;
}
@lgdd
lgdd / build.gradle
Created February 27, 2024 15:01
Liferay - Zip Fragment Collections with Gradle
// To add in the build.gradle at the root of a Liferay workspace
def gitignoreToList(File f) {
def ignores = []
f.eachLine { line ->
if (!line.startsWith('#') && !line.isEmpty()) {
ignores.add(line)
}
}
return ignores
@lgdd
lgdd / docker-compose.yml
Last active March 8, 2024 13:16
Docker Compose from Liferay Cloud Backup
# A quick Docker Compose to build a Liferay stack using Liferay Cloud backup files
# Put the document_library folder and the mysql_dump.sql (or whatever the name) in the same folder as this file.
# Run docker-compose up mysql
# Wait for successful dump import
# Run docker-compose up liferay
version: '3'
services:
liferay:
# you can verify the version in the SQL dump (e.g. 'Liferay Digital Experience Platform 7.4.13 Update 80')
image: liferay/dxp:7.4.13-u102
@lgdd
lgdd / index.html
Created June 1, 2023 10:12
Liferay User Account Fragment
<div class="user-account-fragment">
[@liferay.user_personal_bar/]
</div>
@lgdd
lgdd / search-suggestions.css
Last active December 22, 2023 09:35
Liferay DXP - Search Suggestions
.search-bar-suggestions-dropdown-menu.dropdown-menu {
border-radius: 0;
border-width: 1px;
box-shadow: 0;
}
.search-bar-suggestions-dropdown-menu
.search-bar-suggestions-results-list
.dropdown-subheader {
color: var(--color-brand-primary);
@lgdd
lgdd / release-from-tag.yml
Last active November 3, 2023 15:20
Liferay Workspace - Create Release with GitHub CI
name: Release
on:
push:
tags:
- 'v*'
- '!*-alpha*'
- '!*-beta*'
- '!*-rc*'
@lgdd
lgdd / deploy-from-github.sh
Created May 2, 2023 17:08
Liferay Cloud - Deploy from GitHub
#!/bin/sh
set -e
# List of GitHub repositories
REPOS=$(cat << EOF
https://github.com/jverweijL/Markdown
https://github.com/lgdd/liferay-ocr-documents
EOF
)
@lgdd
lgdd / LiferayService.js
Last active March 15, 2023 10:17
Liferay API for Remote App
const LiferayService = {
get: async (url) => {
if (typeof window['Liferay'] != 'undefined') {
try {
const response = await window['Liferay'].Util.fetch(url);
const data = response.json();
if (data.status) {
window['Liferay'].Util.openToast({
title: data.status,
message: 'An error occured.',